<?php

namespace Renshan\UserBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;

/**
 * User
 *
 * @ORM\Table(name="user")
 * @ORM\Entity(repositoryClass="Renshan\UserBundle\Repository\UserRepository")
 */
class User extends BaseUser
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var array
     *
     * @ORM\OneToMany(targetEntity="Renshan\DetectorBundle\Entity\Target", mappedBy="user")
     */
    private $targets;

    /**
     * @var array
     *
     * @ORM\OneToMany(targetEntity="Renshan\DetectorBundle\Entity\ReqGroup", mappedBy="user")
     */
    private $req_groups;


    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Add target
     *
     * @param \Renshan\DetectorBundle\Entity\Target $target
     *
     * @return User
     */
    public function addTarget(\Renshan\DetectorBundle\Entity\Target $target)
    {
        $this->targets[] = $target;

        return $this;
    }

    /**
     * Remove target
     *
     * @param \Renshan\DetectorBundle\Entity\Target $target
     */
    public function removeTarget(\Renshan\DetectorBundle\Entity\Target $target)
    {
        $this->targets->removeElement($target);
    }

    /**
     * Get targets
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getTargets()
    {
        return $this->targets;
    }

    /**
     * Add reqGroup
     *
     * @param \Renshan\DetectorBundle\Entity\ReqGroup $reqGroup
     *
     * @return User
     */
    public function addReqGroup(\Renshan\DetectorBundle\Entity\ReqGroup $reqGroup)
    {
        $this->req_groups[] = $reqGroup;

        return $this;
    }

    /**
     * Remove reqGroup
     *
     * @param \Renshan\DetectorBundle\Entity\ReqGroup $reqGroup
     */
    public function removeReqGroup(\Renshan\DetectorBundle\Entity\ReqGroup $reqGroup)
    {
        $this->req_groups->removeElement($reqGroup);
    }

    /**
     * Get reqGroups
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getReqGroups()
    {
        return $this->req_groups;
    }
}
